package com.dididoctor.patient.Activity.Usercentre.Consume;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.dididoctor.patient.Dialog.CallPhoneDialog;
import com.dididoctor.patient.MV.EduActivity;
import com.dididoctor.patient.R;


/**
 * Created by liying on 2016/4/29.
 */
public class WithdrawalsFailActivity extends EduActivity {
    private String from;
    private Button mBtnTry, mBtnService;
    private TextView mTvTop, mTvBottom;

    @Override
    public void init() {
        initView();
    }

    @Override
    public void onClickEvent(View view) {
        switch (view.getId()) {
            case R.id.btn_call_service:
                CallPhoneDialog dialog = new CallPhoneDialog(WithdrawalsFailActivity.this, "4001129585");
                dialog.show();
                break;
            case R.id.btn_try:
                setResult(RESULT_OK);
                WithdrawalsFailActivity.this.finish();
                break;
        }

    }

    @Override
    public void setContentLayout() {
        setContentView(R.layout.activity_withdrawalsfail);
    }

    public void initView() {
        from = getIntent().getStringExtra("from");
        mTvTop = (TextView) findViewById(R.id.tv_top);
        mTvBottom = (TextView) findViewById(R.id.tv_bottom);
        if (from.equals("0")) {
            ((TextView) findViewById(R.id.tv_title)).setText("提现失败");
            mTvTop.setText("抱歉提现失败");
            mTvBottom.setText("很抱歉没能提现成功，因此给您带来的不便，敬请谅解");
        } else {
            ((TextView) findViewById(R.id.tv_title)).setText("退款失败");
            mTvBottom.setText("很抱歉没能退款成功，因此给您带来的不便，敬请谅解");
            mTvTop.setText("抱歉退款失败");
        }
        mBtnTry = (Button) findViewById(R.id.btn_try);
        mBtnTry.setOnClickListener(this);
        mBtnService = (Button) findViewById(R.id.btn_call_service);
        mBtnService.setOnClickListener(this);

    }
}
